package com.qiusuo0226.core.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableCharset;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableEngine;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlCharsetConstant;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlEngineConstant;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.qiusuo0226.core.constant.Tables;
import com.qiusuo0226.mysql.pojo.CommonEntity;
import lombok.*;

import java.io.Serializable;

/**
 * 组织机构
 * @author qiusuo
 * @date 2022-04-04
 */
@ToString
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = Tables.CORE_ORGANIZATION)
@Table(name = Tables.CORE_ORGANIZATION, comment = "核心模块：机构单位表")
@TableCharset(MySqlCharsetConstant.UTF8MB4)
@TableEngine(MySqlEngineConstant.InnoDB)
public class OrganizationDO extends CommonEntity implements Serializable {

    private static final long serialVersionUID = 853732971655278701L;


    @TableField(value = "unit_name")
    @Column(name = "unit_name", type = MySqlTypeConstant.VARCHAR, length = 100, comment = "单位名称", defaultValue = "", isNull=false)
    private String unitName;

    @TableField(value = "unit_short_name")
    @Column(name = "unit_short_name", type = MySqlTypeConstant.VARCHAR, length = 100, comment = "单位简称", defaultValue = "", isNull=false)
    private String unitShortName;

    @TableField(value = "parent_unit_iid")
    @Column(name = "parent_unit_iid", type = MySqlTypeConstant.BIGINT, comment = "上级单位唯一标识", isNull=false)
    private Long parentUnitIid;

    @TableField(value = "parent_unit_name")
    @Column(name = "parent_unit_name", type = MySqlTypeConstant.VARCHAR, length = 100, comment = "上级单位名称", defaultValue = "", isNull=false)
    private String parentUnitName;

    @TableField(value = "parent_unit_iids")
    @Column(name = "parent_unit_iids", type = MySqlTypeConstant.VARCHAR, length = 500, comment = "所有上级单位唯一标识，英文逗号分隔，上级部门在前", defaultValue = "", isNull=false)
    private String parentUnitIids;

    @TableField(value = "credit_code")
    @Column(name = "credit_code", type = MySqlTypeConstant.VARCHAR, length = 255, comment = "社会信用代码", defaultValue = "", isNull=false)
    private String creditCode;

    @TableField(value = "division_iid")
    @Column(name = "division_iid", type = MySqlTypeConstant.BIGINT, comment = "所属区划唯一标识", isNull=false)
    private Long divisionIid;

    @TableField(value = "division_name")
    @Column(name = "division_name", type = MySqlTypeConstant.VARCHAR, length = 100, comment = "所属区划名称", defaultValue = "", isNull=false)
    private String divisionName;

    @TableField(value = "division_iids")
    @Column(name = "division_iids", type = MySqlTypeConstant.VARCHAR, length = 500, comment = "所属区划及上级区划唯一标识，英文逗号分隔，上级区划在前", defaultValue = "", isNull=false)
    private String divisionIids;
}
